{* Smarty *}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
 "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>{$larch_name}: Quick search</title>
  <link rel="stylesheet" href="styles/main.css" type="text/css"/>
  <meta http-equiv="Content-Script-Type" content="text/javascript"/>
  <script type="text/javascript" src="js/jquery.js"/></script>
  <script>
{literal}
    // <![CDATA[
    $(document).ready(function () {
     // Clear the default value of input fields when they’re focused, and when
     // unfocused if the value is null then replace the default value.
     $("input").focus(function() {
        if (this.value == this.defaultValue) {
          this.value = "";
        }
      }).blur(function() {
        if (!this.value.length) {
          this.value = this.defaultValue;
        }
      });
    }
    // ]]>
{/literal}
  </script>
</head>
<body>
  <h1 class="title">{$larch_name}</h1>
  <h2 class="subtitle">{$larch_name_subtitle}</h2>

{if isset($error) && ($error != "")}
  {$error}
{/if}

  <p><a href="search.php">Advanced Search</a> – a more advanced search form.</p>

  <form action="{$smarty.server.PHP_SELF}" method="get">
    <table class="search-table">
      <caption class="search-caption">Quick catalogue search</caption>
      <tbody>
        <tr>
          <td>Persistent identifier:</td>
          <td><input type="text" name="pid" value="{$pid_default}"/></td>
        </tr>
        <tr>
          <td>Item name:</td>
          <td><input type="text" name="item_name" value="{$item_default}"/></td>
        </tr>
        <tr>
          <td>Language:</td>
          <td><input type="text" name"lang" value="{$lang_default}"/></td>
          <td>or 
            <select name="lang_pulldown">
              <option value="" selected>Choose a language</option>
            </select>
          </td>
        </tr>
        <tr>
          <td>Country:</td>
          <td>
            <input type="text" name="country" value="{$country_default}"/>
          </td>
          <td>or 
            <select name="country_pulldown">
              <option value="" selected>Choose a country</option>
            </select>
          </td>
        </tr>
        <tr>
          <td><input type="submit" value="Search"/></td>
          <td><input type="reset" value="Reset"/></td>
        </tr>
      </tbody>
    </table>
  </form>

  <hr/>

{if isset($no_results)}
  <p>
{elseif}
{/if}

{include file='footer.tpl'}
</body>
</html>
